import request from '@/utils/request'

// 封装一个权限管理
export const perssionListAPI = () => {
  return request({
    url: '/sys/permission'
  })
}

// 封装一个删除权限
export const delPermissionAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 封装一个添加权限
export const addPermissionAPI = (data) => {
  return request({
    url: `/sys/permission`,
    method: 'post',
    data
  })
}

// 封装一个根据id查询权限详情
export const permDetailAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`
  })
}

// 封装一个根据id更新权限
export const updatePermAPI = (data) => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}
